﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	xmlns:local="clr-namespace:OneStop.UI"
	x:Class="OneStop.UI.PrefsUserControl"
	Height="302" Width="465">
	<UserControl.Resources>
		<local:PercentFormatConverter x:Key="PercentFormatConverter"/>
	</UserControl.Resources>
	<UserControl.DataContext>
		<local:MainProvider/>
	</UserControl.DataContext>

	<Grid x:Name="LayoutRoot" HorizontalAlignment="Left" Width="377" Height="280" VerticalAlignment="Top">
		<Grid.RowDefinitions>
			<RowDefinition Height="30"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="26"/>
			<RowDefinition Height="42"/>
			<RowDefinition Height="23"/>
			<RowDefinition Height="24"/>
			<RowDefinition Height="25"/>
			<RowDefinition Height="27"/>
			<RowDefinition Height="0"/>
			<RowDefinition Height="25"/>
			<RowDefinition Height="0"/>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.272*"/>
			<ColumnDefinition Width="0.231*"/>
			<ColumnDefinition Width="0.231*"/>
			<ColumnDefinition Width="0.266*"/>
		</Grid.ColumnDefinitions>
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.GfLow, Converter={StaticResource PercentFormatConverter}, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="0,8,0,2" HorizontalAlignment="Left" Width="23" Grid.Row="1" />
		<TextBox Grid.Column="1" Text="{Binding Prefs.GfHigh, Converter={StaticResource PercentFormatConverter}, Mode=TwoWay, UpdateSourceTrigger=Default}" Height="20" Margin="28,8,29,2" Width="30" Grid.Row="1" />
		<TextBlock Margin="8,10,12,0" Text="Bail:" TextWrapping="Wrap" Grid.Column="2" Grid.Row="1" Height="20"/>
		<TextBox Height="20" Grid.Column="3" Text="{Binding Prefs.GfLowBailout, Converter={StaticResource PercentFormatConverter}, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="3,8,0,2" HorizontalAlignment="Left" Width="30" Grid.Row="1" />
		<TextBox Grid.Column="3" Text="{Binding Prefs.GfHighBailout, Converter={StaticResource PercentFormatConverter}, Mode=TwoWay, UpdateSourceTrigger=Default}" Height="20" Margin="38,8,32,2" Width="30" d:LayoutOverrides="HorizontalAlignment" Grid.Row="1" />
		<TextBlock Margin="8,8,-8,-2" TextWrapping="Wrap" Grid.Row="2" Height="20" FontWeight="Bold"><Run Text="D"/><Run Text="e"/><Run Text="co"/><Run Text=" Stops"/><Run Text=":"/></TextBlock>
		<TextBlock Margin="0,9,-16,1" Text="Gradient Factorts" TextWrapping="Wrap" Height="20" FontWeight="Bold"/>
		<TextBlock Margin="0,10,0,0" TextWrapping="Wrap" HorizontalAlignment="Right" Width="37" Grid.Row="1" Height="20"><Run Text="Dive"/><Run Text=":"/></TextBlock>
		<TextBlock Margin="15,6,0,16" TextWrapping="Wrap" Grid.Row="3" Height="20"><Run Text="Last Stop"/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.LastStopDepth, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,2,0,20" HorizontalAlignment="Left" Width="23" Grid.Row="3" />
		<TextBlock Margin="8,13,8,9" TextWrapping="Wrap" Grid.Row="3" Height="20" Grid.Column="2"><Run Text="Increment"/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<TextBox Height="20" Grid.Column="3" Text="{Binding Prefs.StopDepthIncrement, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="10,13,0,9" HorizontalAlignment="Left" Width="23" Grid.Row="3" />
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.StopTimeIncrement, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,0,0,0" Grid.Row="3" VerticalAlignment="Bottom" d:LayoutOverrides="Height" HorizontalAlignment="Left" Width="23" />
		<TextBlock Margin="15,26,0,-4" TextWrapping="Wrap" Grid.Row="3" Height="20" ToolTipService.ToolTip="Stop Time Increment" d:LayoutOverrides="GridBox"><Run Text="Time Increm."/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<TextBlock Margin="8,4,-8,-1" TextWrapping="Wrap" Grid.Row="4" Height="20" FontWeight="Bold"><Run Text="Gas RMV"/><Run Text=":"/></TextBlock>
		<TextBlock Margin="23,5,8,-1" TextWrapping="Wrap" Grid.Row="5" Height="20"><Run Text="Dive"/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<TextBlock Margin="4,4,12,0" TextWrapping="Wrap" Grid.Row="5" Height="20" Grid.Column="2"><Run Text="Deco"/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.RMVDive, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,5,0,-1" Grid.Row="5" HorizontalAlignment="Left" Width="23" />
		<TextBox Height="20" Grid.Column="3" Text="{Binding Prefs.RMVDeco, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,4,0,0" Grid.Row="5" HorizontalAlignment="Left" Width="23" />
		<TextBlock Margin="23,5,8,0" TextWrapping="Wrap" Grid.Row="6" Height="20"><Run Text="Units"/><Run Text=":"/><LineBreak/><Run Text=""/><Run Text=":"/></TextBlock>
		<RadioButton Margin="8,4,-13,4" Content="Metric" Grid.Column="1" Grid.Row="6" IsChecked="{Binding IsMetric, Mode=TwoWay, UpdateSourceTrigger=Explicit}" GroupName="Units" d:LayoutOverrides="VerticalAlignment, GridBox"/>
		<RadioButton Margin="0,4,-19,0" Content="Imperial" Grid.Column="2" Grid.Row="6" GroupName="Units" Height="17" VerticalAlignment="Top"/>
		<TextBlock Margin="23,7,8,0" TextWrapping="Wrap" Grid.Row="7" Height="20"><Run Text="Ascent"/><Run Text=":"/></TextBlock>
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.AscentRate, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,7,0,0" Grid.Row="7" HorizontalAlignment="Left" Width="30" />
		<TextBox Height="20" Grid.Column="3" Text="{Binding Prefs.DescentRate, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="10,7,0,0" Grid.Row="7" HorizontalAlignment="Left" Width="23" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" >
			<TextBox.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="-1.21"/>
					<TranslateTransform/>
				</TransformGroup>
			</TextBox.RenderTransform>
		</TextBox>
		<TextBlock Margin="15,7,0,0" TextWrapping="Wrap" Grid.Row="7" Height="20" Grid.Column="2"><Run Text="Descent"/><Run Text=":"/></TextBlock>
		<CheckBox Margin="8,4,-36,4" Content="Time is Runtime" Grid.Column="1" Grid.Row="9" IsChecked="{Binding Prefs.RuntimeFlag, Mode=TwoWay, UpdateSourceTrigger=Explicit}"/>
		<TextBlock Margin="23,0,8,-20" TextWrapping="Wrap" Grid.Row="10" Height="20" VerticalAlignment="Bottom" d:LayoutOverrides="Height"><Run Text="Max PPO2"/><Run Text=":"/></TextBlock>
		<TextBox Height="20" Grid.Column="1" Text="{Binding Prefs.PPO2Max, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="8,0,0,-20" Grid.Row="10" HorizontalAlignment="Left" Width="30" VerticalAlignment="Bottom" d:LayoutOverrides="Height" />
		<TextBox Height="20" Grid.Column="3" Text="{Binding Prefs.SetpointDefault, Mode=TwoWay, UpdateSourceTrigger=Default}" Margin="9.998,-0.148,0,-19.853" Grid.Row="10" HorizontalAlignment="Left" Width="36.983" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" >
			<TextBox.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="-1.21"/>
					<TranslateTransform/>
				</TransformGroup>
			</TextBox.RenderTransform>
		</TextBox>
		<TextBlock Margin="15,0,0,-20" TextWrapping="Wrap" Grid.Row="10" Height="20" Grid.Column="2" VerticalAlignment="Bottom" d:LayoutOverrides="Height"><Run Text="Default SP"/><Run Text=":"/></TextBlock>
		<Button x:Name="SaveAsDefault" Margin="13,0,0,8" Content="Set as Default" Grid.Column="3" Click="SaveAsDefault_Click"/>
	</Grid>
</UserControl>